//
//  FIOperationTest.m
//  OpenglPing
//
//  Created by 100TV protocal on 12-11-8.
//
//

#import "FIOperationTest.h"

@implementation FIOperationTest

@synthesize nIndex = _nIndex;

- (void)main{
    NSLog(@"task %i run … ", _nIndex);
//    [NSThread sleepForTimeInterval:10];
    NSTimer * timer = [NSTimer timerWithTimeInterval:2 target:self selector:@selector(doit:) userInfo:nil repeats:NO];
    [timer fire];
    //while (!didDisconnect) {
        [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
    //}
    NSLog(@"task %i is finished. ",_nIndex);
}

- (void)doit:(id)sender
{
    NSLog(@"do sender");
    didDisconnect = YES;
}

- (void)dealloc
{
    NSLog(@"do dealloc");
    [super dealloc];
}

@end
